home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / cmsrc392.zip / ROMANU.MF < prev    next >
Text File  |  1992-03-30  |  35KB  |  739 lines

  1. % Computer Modern Roman upper case:
  2. % These letters were originally coded by D. E. Knuth in November, 1979,
  3. % inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
  4. % Sans serif designs by Richard Southall were added in April, 1982.
  5. % The programs were revised for the new \MF\ conventions in 1985.
  6.  
  7. % Character codes \0101 through \0132 are generated.
  8.  
  9. cmchar "The letter A";
  10. beginchar("A",13u#,cap_height#,0);
  11. adjust_fit(cap_serif_fit#,cap_serif_fit#);
  12. numeric left_stem,right_stem,outer_jut,alpha;
  13. right_stem=cap_stem-stem_corr;
  14. left_stem=min(cap_hair if hefty: -3stem_corr fi,right_stem);
  15. outer_jut=.8cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
  16. x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o+apex_oo;
  17. alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
  18. penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
  19. penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
  20. z0=whatever[z1r,z2r]=whatever[z3l,z4l];
  21. if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
  22.  fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
  23.   --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
  24.   ...{up}z0+.5left--cycle; % left and right diagonals
  25. else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
  26.   --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
  27. penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
  28. penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
  29. if hefty: y5r else: y5 fi =5/12y0;
  30. y5r-y5l=y6r-y6l=cap_band; penstroke z5e--z6e; % bar line
  31. if serifs: numeric inner_jut; pickup tiny.nib;
  32.  prime_points_inside(1,2); prime_points_inside(4,3);
  33.  if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
  34.  else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
  35.  dish_serif(1',2,a,1/2,outer_jut,b,.6,inner_jut)(dark);  % left serif
  36.  dish_serif(4',3,c,1/2,inner_jut,d,1/3,outer_jut); fi  % right serif
  37. penlabels(0,1,2,3,4,5,6); endchar;
  38.  
  39. cmchar "The letter B";
  40. beginchar("B",12.5u#,cap_height#,0);
  41. italcorr .75cap_height#*slant-.5u#;
  42. adjust_fit(cap_serif_fit#,0);
  43. numeric left_stem,right_curve,middle_weight;
  44. left_stem=cap_stem-hround 2stem_corr; middle_weight=.6vair+.5;
  45. pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
  46. lft x1l=lft x2l=hround max(2u,3u-.5left_stem); top y1=h; bot y2=0;
  47. filldraw stroke z1e--z2e; % stem
  48. penpos3(cap_band,90); penpos4(cap_band,90);
  49. penpos6(middle_weight,-90); penpos7(middle_weight,-90);
  50. penpos8(middle_weight,90); penpos9(middle_weight,90);
  51. penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
  52. penpos11(cap_band,-90); penpos12(cap_band,-90);
  53. z3r=top z1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
  54. z12r=bot z2; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
  55. x4=x6; x9=x11=x4+.5u; x7=x8=x1; x9l:=x4+.25u;
  56. x5r=hround(w-1.5u); x10r=hround(w-u);
  57. if serifs: right_curve=cap_curve-stem_corr; x4=.5[x1,w-1.5u];
  58. else: right_curve=cap_curve-3stem_corr; x4=.5[x1,w-2.5u];
  59.  x4l:=x4l-.5u; x9l:=x9l-.5u; fi
  60. x6l:=x6l-.5u; x11l:=x11l-.5u;
  61. fill stroke z3e..super_arc.e(4,5) & super_arc.e(5,6)..z7e;  % upper lobe
  62. fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e;  % lower lobe
  63. if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
  64.  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi  % lower serif
  65. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
  66.  
  67. cmchar "The letter C";
  68. if serifs: beginchar("C",13u#,cap_height#,0);
  69.  italcorr cap_height#*slant-.5u#;
  70.  adjust_fit(0,0);
  71.  pickup fine.nib; pos1(cap_hair,0); pos2(cap_band,90);
  72.  pos3(cap_curve,180); pos4(cap_band,270); pos5(hair,360);
  73.  rt x1r=rt x5r=hround(w-u); lft x3r=hround u; x2=x4=.55[x3,x1];
  74.  top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
  75.  bot y1=min(vround max(.6h,x_height-.5vair),bot y2l-eps);
  76.  y5=max(good.y .95(h-y1),y4l+eps);
  77.  (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
  78.  (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
  79.  filldraw stroke z1e{x2-x1,10(y2-y1)}
  80.   ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...{up}z5e; % arc
  81.  pos6(.3[fine.breadth,cap_hair],0); x6r=x1r; top y6=h+o;
  82.  x1r-x1'=2cap_curve-fine; y1'=y1;
  83.  path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
  84.  numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
  85.  filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
  86. else: beginchar("C",11.5u#,cap_height#,0);
  87.  italcorr cap_height#*slant-.5u#;
  88.  adjust_fit(0,0);
  89.  pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
  90.  pos3(cap_curve,180); pos4(slab,270); pos5(flare,275);
  91.  rt x1r=hround(w-1.1u); x2=x4=.5w+1.25u;
  92.  lft x3r=hround max(u,2u-.5cap_curve); rt x5r=hround(w-.9u);
  93.  top y1r=vround .95h+o; top y2r=h+o; y3=.5h;
  94.  bot y4r=-o; bot y5r=vround .08h-o; y5l:=good.y y5l; x5l:=good.x x5l;
  95.  filldraw stroke rterm.e(2,1,right,.9,4) & super_arc.e(2,3)
  96.   & super_arc.e(3,4) & term.e(4,5,right,.8,4); fi % arc and terminals
  97. math_fit(-.3cap_height#*slant-.5u#,.5ic#);
  98. penlabels(1,1',2,3,4,5,6); endchar;
  99.  
  100. cmchar "The letter D";
  101. beginchar("D",13.5u#,cap_height#,0);
  102. italcorr .7cap_height#*slant-.5u#;
  103. adjust_fit(cap_serif_fit#,0);
  104. pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
  105. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
  106. filldraw stroke z1e--z2e; % stem
  107. penpos3(cap_band,90); penpos4(cap_band,90);
  108. penpos5(cap_curve-stem_corr,0);
  109. penpos6(cap_band,-90); penpos7(cap_band,-90);
  110. z3r=top z1; y4=y3; y5=.51[y4,y6]; y6=y7;
  111. z7r=bot z2; x4=x6=.5w+.25u; x5r=hround(w-u);
  112. x4l:=x6l:=x4-.25cap_curve;
  113. fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e;  % lobe
  114. if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
  115.  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi  % lower serif
  116. math_fit(0,ic#-.5u#); penlabels(1,2,3,4,5,6,7); endchar;
  117.  
  118. cmchar "The letter E";
  119. beginchar("E",12u#-width_adj#,cap_height#,0);
  120. italcorr cap_height#*slant-beak_jut#-.5u#;
  121. adjust_fit(cap_serif_fit#,0);
  122. h:=vround(h-stem_corr);
  123. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  124. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
  125. filldraw stroke z1e--z2e; % stem
  126. pickup crisp.nib; pos3(slab,90); pos4(hair,0);
  127. top y3r=h; x3=x1; rt x4r=hround(w-u); y4=good.y(y3l-beak)-eps;
  128. arm(3,4,e,beak_darkness,beak_jut);  % upper arm and beak
  129. pos5(cap_bar,-90); pos6(hair,0);
  130. top y5l=vround(.52[y2,y1]+.5cap_bar); x5=x1;
  131. pos0(cap_bar,90); pos7(hair,0);
  132. z0=z5; x6=x7; y6-y5l=y0l-y7;
  133. if serifs: rt x6r=hround(w-4.4u+.5hair); y6=good.y(y5l+.6beak)+eps;
  134.  rt x9r=hround(w-.5u);
  135. else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
  136. arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0);  % middle arm and serif
  137. pos8(slab if not serifs:+2stem_corr fi,-90); pos9(hair,0);
  138. bot y8r=0; x8=x2; y9=good.y(y8l+7/6beak)+eps;
  139. arm(8,9,h,beak_darkness,1.5beak_jut);  % lower arm and beak
  140. if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
  141.  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi  % lower serif
  142. math_fit(0,.5ic#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
  143.  
  144. cmchar "The letter F";
  145. beginchar("F",11.5u#-width_adj#,cap_height#,0);
  146. italcorr cap_height#*slant-beak_jut#-.25u#;
  147. adjust_fit(cap_serif_fit#,0);
  148. h:=vround(h-stem_corr);
  149. pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
  150. lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
  151. filldraw stroke z1e--z2e; % stem
  152. pickup crisp.nib; pos3(slab,90); pos4(hair,0);
  153. top y3r=h; x3=x1; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps;
  154. arm(3,4,e,beak_darkness,beak_jut);  % upper arm and beak
  155. pos5(cap_bar,-90); pos6(hair,0);
  156. top y5l=vround(.5[y2,y1]+.5cap_bar); x5=x1;
  157. pos0(cap_bar,90); pos7(hair,0);
  158. z0=z5; x6=x7; y6-y5l=y0l-y7;
  159. if serifs: rt x6r=hround(w-4u+.5hair); y6=good.y(y5l+.6beak)+eps;
  160.  rt x9r=hround(w-.5u);
  161. else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
  162. arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0);  % middle arm and serif
  163. if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
  164.  dish_serif(2,1,c,1/3,cap_jut,d,1/3,1.25cap_jut); fi  % lower serif
  165. math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
  166.  
  167. cmchar "The letter G";
  168. if serifs: beginchar("G",14u#,cap_height#,0);
  169.  italcorr cap_height#*slant-1.5u#-.5cap_serif_fit#;
  170.  adjust_fit(0,.5cap_serif_fit#);
  171.  pickup tiny.nib; pos0(cap_stem,0); pos7(cap_stem,0);
  172.  rt x0r=hround(w-2u); y0=good.y(.1[bar_height,x_height]+1)